<{include file="public/header.html"}>
<script type="text/javascript" src="<{$smarty.const.STATIC_COMPONENT_URL}>js/common.js"></script>
<{FRM_XOAD::getClientCode()}>

<script type="text/javascript">
function validate()
{
    if (validateEmail())
	{
		document.signup.submit();
	}
	return false;
}

function validateEmail()
{
	var form = document.signup;
	var email = document.signup.email;		
	var username = document.signup.username;
	var password = document.signup.password;
	var confirm_password = document.signup.confirm_password;
	var postcode = document.signup.postcode;
	var telephone = document.signup.telephone;
	var mobilephone = document.signup.mobilephone;
	
	email.value = trim(email.value);
	username.value = trim(username.value);
	
	if (username.value == '')
	{
		alert('<{#_LB_VALIDATE_USERNAME#|utf8_escape_js}>');
		username.focus();
		return false;
	}
	
	if(password.value == ''){
		alert('<{#_LB_VALIDATE_PASSWORD_EMPTY#|utf8_escape_js}>');
		password.focus();
		return false;
	}
	
	if (email.value == '')
	{
		alert('<{#_LB_VALIDATE_EMAIL#|utf8_escape_js}>');
        email.focus();
		return false;
	}
	
	if(isNaN(postcode.value)){
		alert('<{#_LB_VALIDATE_NUMBER#|utf8_escape_js}>');
        postcode.focus();
		return false;
	}
	
	if(isNaN(telephone.value)){
		alert('<{#_LB_VALIDATE_NUMBER#|utf8_escape_js}>');
		telephone.focus();
		return false;
	}
	
	if(isNaN(mobilephone.value)){
		alert('<{#_LB_VALIDATE_NUMBER#|utf8_escape_js}>');
		mobilephone.focus();
		return false;
	}
	
	if (!emailCheck(email.value))
	{
		alert('<{#_LB_FORMAT_EMAIL#|utf8_escape_js}>');
        email.focus();
		return false;
	}
    
	return true;
}

</script>
<div class="container">
    	<form action="" method="post" name="signup" onsubmit="return validate() ;" >
    		<input type="hidden" id="act" name="act" value="1" />
        	<div class="signup">
                <div class="signup-title"><span>Sign up</span></div>
                <div class="form-signup">
                <ul class="error">
                <{foreach from=$error key=key item=value}>
                	<li><{#$value#}></li>
                <{/foreach}>
                </ul>
                	<div class="row">
                    	<label>First Name</label><input type="text" name="firstname" value="<{$customer->firstname}>" />
                    </div>
                    <div class="row">
                        <label>Last Name</label><input type="text" name="lastname" value="<{$customer->lastname}>"  />
                    </div>
                    <div class="row">
                    	<label>Gender</label><span>Female</span><input type="radio" name="sex" value="1" <{if $customer->sex == 1}> checked="checked" <{/if}>/>
                    	<span>Male</span><input type="radio" name="sex" value="0" <{if $customer->sex == 0}> checked="checked" <{/if}> />
                    </div>
                    <div class="row">
                        <label>Username</label><input type="text" name="username" value="<{$customer->lastname}>"   />
                    </div>
                    <div class="row">
                        <label>Password</label><input type="password" name="password" />
                    </div>
                    <div class="row">
                        <label>Confirm Password</label><input type="password" name="confirm_password" />
                    </div>
                    <div class="row">
                        <label>Email</label><input type="text" name="email" value="<{$customer->email}>"   />
                    </div>
                    <div class="row">
                        <label>Address</label><input type="text" name="address" size="50" value="<{$customer->address}>"   />
                    </div>
                    <div class="row">
                        <label>Place</label><input type="text" name="place" size="20" value="<{$customer->place}>"   />
                    </div>
                    <div class="row">
                        <label>Post Code</label><input type="text" name="postcode" value="<{$customer->postcode}>"   />
                    </div>
                    <div class="row">
                        <label>Telephone</label><input type="text" name="telephone" value="<{$customer->telephone}>"   />
                    </div>
                    <div class="row">
                        <label>Mobile phone</label><input type="text" name="mobilephone" value="<{$customer->mobilephone}>"   />
                    </div>
                    <br/><br/>
                    <div class="row">
                        <a href="#" onclick="validate()" ><img src="<{$smarty.const.STATIC_COMPONENT_URL}>images/btnContinue.jpg" class="btnContinue" /></a>
                        <a href="<{$smarty.const.APPLICATION_URL}>" onclick="validate()" ><img src="<{$smarty.const.STATIC_COMPONENT_URL}>images/btnCancel.jpg" /></a>
                    </div>
                </div>
            </div>
        </form>
    </div><!--end container-->
    <div class="clear"></div>
<{include file="public/footer.html"}>